import { v4 as uuidv4 } from 'uuid'
//生产一个随机字符串，持久存储，每次执行不能变
export const getUUID = () => {
  let uuid_token = localStorage.getItem('UUIDTOKEN')
  if (!uuid_token) {
    //生产一个
    uuid_token = uuidv4()
    //本地存一遍
    localStorage.setItem('UUIDTOKEN', uuid_token)
  }
  return uuid_token
}
